//
//  CommonDefine.h
//  cloudMall
//
//  Created by 邓志平 on 16/10/14.
//  Copyright © 2016年 DongHui. All rights reserved.
//

#pragma mark - Server URL
//#ifdef DEBUG
//#define APPBASEURL [[NSUserDefaults standardUserDefaults] valueForKey:@"url_preference"]
//#define APPBASEURL @"http://10.66.76.70:5555"
//#define ImageURL @""
//#define H5URL  @"http://10.66.76.70/insurance/"
//static const DDLogLevel ddLogLevel = DDLogLevelAll;
//#else
#define APPBASEURL @"http://221.226.241.34:63240"
#define ImageURL @""
#define H5URL  @"http://221.226.241.34:63240/h5"
//#endif

#pragma mark - NSUserDefault define
#define ISLOGIN_EMPID  @"EmpId"
#define HTTPTOKEN  @"tokenOfHttp"


#pragma mark - 第三方Key
#define UmSocialAppkey     @"58aa9846a40fa3082d0009be"
#define WechatAppkey       @"wxe91ec9c75d2c198c"
#define WechatAppSecret    @"03952a4c4d8965baf5cfd41e2a06d3f1"

#pragma mark - String define

#define RESCODE  200
#define RESULT  @"true"
#define TOTAL  @"total"
#define ROWS   @"rows"
#define REQUEST_RESULT  @"result"
#define REQUEST_RESCODE  @"resCode"
#define REQUEST_RESMSG   @"resMsg"
#define REQUEST_DATA     @"data"

#pragma mark - NSNotificationCenter
#define CURRENTPAGECHANGE @"currentPageChange"
#define LOGINOUTNOTIFI    @"loginOutNotification"
#define ISHIDELOGINBTN    @"isHideLoginBtn"

#pragma mark - UI components size
#define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height
#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width

#pragma mark -  Device version
#define IS_IOS_7 ([Utils deviceSystemMajorVersion] >= 7)
#define IS_IOS_7_1 (fabs( (double)[[UIDevice currentDevice].systemVersion doubleValue])>=7.1f)
#define IS_IOS_8 (fabs( (double)[[UIDevice currentDevice].systemVersion doubleValue])>=8)
#define IOS_6 ([[[UIDevice currentDevice] systemVersion] intValue] >= 6)
#define IS_IPHONE_5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON )
#define IS_IPHONE_6 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )667 ) < DBL_EPSILON )
#define IS_IPHONE_PLUS ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )736 ) < DBL_EPSILON )

#pragma mark -  common method
#define MainStory [UIStoryboard storyboardWithName:@"Main" bundle:nil]
#define HomeStory [UIStoryboard storyboardWithName:@"Home" bundle:nil]
#define NoticeStory [UIStoryboard storyboardWithName:@"Notice" bundle:nil]
#define MineStory [UIStoryboard storyboardWithName:@"MyLottery" bundle:nil]
#define FindStory [UIStoryboard storyboardWithName:@"Find" bundle:nil]


#define AppContext [AppGlobalContext shareManagement]
#define WeakSelf __weak typeof(self) weakSelf = self;
#define TheAppDelegate ((AppDelegate *)[[UIApplication sharedApplication] delegate])
#define APP_CURRENT_VERSIONS    [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]

#pragma mark -  common color

#define RGBA(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]
#define NavigationBarColor   [Utils colorWithHexString:@"E90D19"]

#pragma mark -  common fonts
#define PingFangSC_FONT(fontSize) [UIFont fontWithName:@"PingFang SC" size:fontSize]
#define CustomerFont(fontName,fontSize) [UIFont fontWithName:fontName size:fontSize];


#pragma mark -  typedef enum 
typedef enum
{
    RegisteType = 1,    //注册
    LoginType,          //登录
    ForgetPwdType       //忘记密码
} CodeType;             //验证码类型

typedef enum
{
    HomeVC = 0,      //首页
    ShopVC,        //商城
    MineVC      //我的
} WhichTabbar;

typedef enum
{
    EmptyShareViewOfNoNet = 1,      //没有网络
    EmptyShareViewOfNoData,        //没有数据
    EmptyShareViewOfResquestFailed      //请求失败，本地又没数据
} EmptyShareViewType;

typedef enum
{
    NONetStatus = 1,      //无网络
    WiFiNetStatus,          //wifi网络
    WWANNetStatus     //运营商网络
} AppNetStatus;

typedef enum
{
    OrderAll = 0,              //全部订单
    OrderBaoZhang,            //保障中
    OrderFinished,      //已终止
    OrderWaitingForDo,  //待处理
}OrderType;

typedef enum
{
    GaoQiStatus = 0,        //过期
    BaoZhangStatus,         //保障中
    FinishedStatus,         //已终止
    WaitingPayStatus,       //待支付
    YuYueStatus,            //预约
    XuBaoStatus             //及时续保
}OrderStatus;
#pragma mark - performSelector方法在ARC模式下会有警告
//--------------------------------------------------------------------------------------------------
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
#pragma clang diagnostic pop

//使用宏忽略警告
#define SuppressPerformSelectorLeakWarning(Stuff)                                                                   \
do {                                                                                                            \
_Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Warc-performSelector-leaks\"") Stuff; \
_Pragma("clang diagnostic pop")                                                                             \
} while (0)


